<head>
  <script src="../scripts/vue.min.js"></script>
  <script src="../scripts/layer-v3.1.1/layer/layer.js"></script>
  <script src="/frame/layui-master/src/layui.js"></script>
  <link rel="stylesheet" href="/frame/layui-master/src/css/layui.css">
  <link rel="stylesheet" href="/frame/layui-master/src/css/gloabal/global.css">
  <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  <!-- 自定义函数 -->
  <script src="/common/fun.js"></script>
</head>
<div class="header" id="header1">
  <ul class="layui-nav" style="background-color:#23262E;" >
    <img src='/image/default/header_logo.png'>
    <li class="layui-nav-item"><a href="/index.php" class="iconfont">首页</a></li>
    <li class="layui-nav-item"><a href="/blog/index.php" class="iconfont" target = "_blank">社区</a></li>
    <li class="layui-nav-item">
      <a href="javascript:;" class="iconfont">控制台</a>
      <dl class="layui-nav-child">
        <a href="/device/device.simulate.php" class="iconfont">Mqtt测试工具</a>
        <a href="/device/device.monitor.php" class="iconfont">控制</a>
        <a href="/device/device.manage.php" class="iconfont">管理</a>
      </dl>
    </li>
    <li class="layui-nav-item"><a href="/about/index.php" class="iconfont">智能硬件</a></li>
    <li class="layui-nav-item">
      <a href="http://47.102.150.235/blog/view.php?blogid=1555681653980" class="iconfont" target = "_blank">文档</a>
    </li>
    <li class="layui-nav-item"><a href="http://igeekiot.com/blog/view.php?blogid=1555681653980" class="iconfont">示例</a></li>
    <li class="layui-nav-item"><a href="/about/index.php" class="iconfont">关于</a></li>
    <!-- 已登录 -->
    <template v-if="user.login=='true'">
      <div class="nav-user" >
        <a class='avatar' :href="'/user/home.php?userid='+user.userid">
        <img id='image-avatar' :src="user.avatar">
        <cite id='nickname'>{{ user.nickname }}</cite>
        <i>VIP</i>
        </a>
        <div class='nav'>
        <a href='/user/set.php' target = "_blank" ><i class='iconfont icon-shezhi'></i>设置</a>
        <a href='/user/logout.php'><i class='iconfont icon-tuichu' style='top: 0; font-size: 22px;'></i>退了</a>
        </div>  
      </div>  
    </template>
    <!-- 未登录 -->
    <template v-else>
      <div class="nav-user unlogin" >
        <a class="unlogin" href="/user/login.php"><i class="iconfont icon-touxiang"></i></a>
        <span>
          <a href="javascript:location.href='/user/login.php?backurl='+location.href">登入</a>
          <a href="javascript:location.href='/user/register.php?backurl='+location.href">注册</a>
        </span>        
    </div>
  </template>
  </ul> 
</div>
<script>
  layui.use('element', function(){
    var element = layui.element;
  });
</script>